const themeList = [{
		title: '官方',
		name: 'rf',
		color: '#58CFF9',
		id:0,
	},
	{
		title: '桃红',
		name: 'gray',
		color: '#fa436a',
		id:13,
	},
	{
		title: '嫣红',
		name: 'red',
		color: '#e54d42',
		id:1,
	},
	{
		title: '桔橙',
		name: 'orange',
		color: '#f37b1d',
		id:2,
	},
	{
		title: '明黄',
		name: 'yellow',
		color: '#fbbd08',
		id:3,
	},
	{
		title: '橄榄',
		name: 'olive',
		color: '#8dc63f',
		id:4,
	},
	{
		title: '森绿',
		name: 'green',
		color: '#39b54a',
		id:5,
	},
	{
		title: '天青',
		name: 'cyan',
		color: '#1cbbb4',
		id:6,
	},
	{
		title: '海蓝',
		name: 'blue',
		color: '#0081ff',
		id:7,
	},
	{
		title: '姹紫',
		name: 'purple',
		color: '#6739b6',
		id:8,
	},
	{
		title: '木槿',
		name: 'mauve',
		color: '#9c26b0',
		id:9,
	},
	{
		title: '桃粉',
		name: 'pink',
		color: '#e03997',
		id:10,
	},
	{
		title: '棕褐',
		name: 'brown',
		color: '#a5673f',
		id:11,
	},
	{
		title: '墨黑',
		name: 'black',
		color: '#333333',
		id:14,
	},
	{
		title: '墨绿',
		name: 'molv',
		color: '#278657',
		id:14,
	},
	{
		title: '玄灰',
		name: 'grey',
		color: '#8799a3',
		id:12,
	}
]

const skin = {
	state: {
		themeList : themeList,
		themeColor: uni.getStorageSync('xwgj_themeColor') || themeList[0]
	},
	getters: {
		themeColor: state => state.themeColor,
	},
	mutations: {
		setThemeColor(state, val) {
			state.themeColor = val;
			uni.setStorageSync('xwgj_themeColor', val);
		}
	},
	actions: {
		// s设置状态栏
		setSkin({
			state
		}, data) {
			// 设置navbar标题、颜色
			// uni.setNavigationBarColor({
			// 	frontColor: '#ffffff',
			// 	backgroundColor: state.themeColor.color
			// });
			// uni.setTabBarStyle({
			// 	selectedColor: state.themeColor.color
			// });
		},
		setSkinTab({
			state
		}, data) {
			var v = ['home','category','find','user']
			// v.forEach((path, index) => {
			// 	var selectedIconPath = '/static/img/tabBar/' + path + '/' + state.themeColor.id + '.png'
			// 	uni.setTabBarItem({
			// 		index,
			// 		selectedIconPath
			// 	});
			// });
		}
	}
};

export default skin;
